<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>

	<title>textcasing</title>
	
	<script type="text/javascript" src="footballpool.js"></script>
	
	<script type="text/javascript" charset="utf-8">
    // Função responsável por inserir linhas na tabela
    function inserirLinhaTabela(id, myArray) {

        // Captura a referência da tabela com id “minhaTabela”
        var table = document.getElementById(id);
        // Captura a quantidade de linhas já existentes na tabela
        var numOfRows = table.rows.length;
        // Captura a quantidade de colunas da última linha da tabela
        var numOfCols = table.rows[numOfRows-1].cells.length;

		if (numOfCols != myArray.length) throw new Error(500, "quantidade de parametros errada" );
        // Insere uma linha no fim da tabela.
        var newRow = table.insertRow(numOfRows);
	
        // Faz um loop para criar as colunas
        for (var j = 0; j < numOfCols; j++) {
            // Insere uma coluna na nova linha 
            newCell = newRow.insertCell(j);
            // Insere um conteúdo na coluna
            newCell.innerHTML = myArray[j];
        }

    }
    //comentario

	getStadiumUrl = function () {

	var parameters = Schema.getAAttr("StadiumURL");
	parameters.getAAttr("sStadiumName").setValue(document.getElementById("stadiumURLText").value);  
//1ª		
//	var teste = new Elements();
//	Schema.getAAttr("InvertStringCase").getAAttr("sAString").setValue(document.getElementById("TextCasingText").value);
//	alert(Schema.getAAttr("InvertStringCase").getAAttr("sAString").getValue());
//2a
//	Elements.schema.getAAttr("InvertStringCase").getAAttr("sAString").setValue(document.getElementById("TextCasingText").value);
//	alert(Elements.schema.getAAttr("InvertStringCase").getAAttr("sAString").getValue());
			
	Info.InfoSoap.StadiumURL (parameters, stadiumUrlResponse);
	}		
	
	stadiumUrlResponse = function (parameters) {
		myArray = [];
		myArray.push(parameters.getAAttr("StadiumURLResult").getValue());
		inserirLinhaTabela("stadiumURLTable", myArray);
	}

	TopGoalScorers = function () {

		var parameters = Schema.getAAttr("TopGoalScorers");
		parameters.getAAttr("iTopN").setValue(document.getElementById("TopGoalScorersText").value);  
//1ª		
//		var teste = new Elements();
//		Schema.getAAttr("InvertStringCase").getAAttr("sAString").setValue(document.getElementById("TextCasingText").value);
//		alert(Schema.getAAttr("InvertStringCase").getAAttr("sAString").getValue());
	//2a
//		Elements.schema.getAAttr("InvertStringCase").getAAttr("sAString").setValue(document.getElementById("TextCasingText").value);
//		alert(Elements.schema.getAAttr("InvertStringCase").getAAttr("sAString").getValue());
				
		Info.InfoSoap.TopGoalScorers (parameters, TopGoalScorersResponse);
	}		
		
	TopGoalScorersResponse = function (parameters) {
		for (var i = 0; i < parameters.getAAttr("TopGoalScorersResult").getAttr().length; i++) {
			myArray = [];
			myArray.push(parameters.getAAttr("TopGoalScorersResult", i).getAAttr("tTopGoalScorer").getAAttr("sName").getValue());
			myArray.push(parameters.getAAttr("TopGoalScorersResult", i).getAAttr("tTopGoalScorer").getAAttr("iGoals").getValue());
			myArray.push(parameters.getAAttr("TopGoalScorersResult", i).getAAttr("tTopGoalScorer").getAAttr("sCountry").getValue());
			myArray.push(parameters.getAAttr("TopGoalScorersResult", i).getAAttr("tTopGoalScorer").getAAttr("sFlag").getValue());
			inserirLinhaTabela("TopGoalScorersTable", myArray);	
		}
	}
	
	</script>
	
</head>

<body>
	<form action="" accept-charset="utf-8">
		<fieldset>
			<input type="text" name="stadiumURLText" value="" id="stadiumURLText"/>	
			<input type="button" value="Continue &rarr;" onclick="getStadiumUrl()"/>		
		</fieldset>

		
	</form>
	
	<div class="stadiumURLConteudo">
		<table id="stadiumURLTable" border="1">
		
				<tr>
					<th>stadiumURL</th>
				</tr>	
		</table>
	</div>	
	
	<hr />
	
		<form action="" accept-charset="utf-8">
		<fieldset>
			<input type="text" name="TopGoalScorersText" value="" id="TopGoalScorersText"/>	
			<input type="button" value="Continue &rarr;" onclick="TopGoalScorers()"/>
		</fieldset>
	</form>
		
	<div class="TopGoalScorersConteudo">
		<table id="TopGoalScorersTable" border="1">
		
				<tr>
					<th>sName</th>
					<th>iGoals</th>
					<th>sCountry</th>
					<th>sFlag</th>
				</tr>	
		</table>
	</div>

		



	
</body>
</html>